import React from 'react';
import ReactDOM from 'react-dom/client';
import {BrowserRouter as Router} from 'react-router-dom';
import {ConfigProvider, theme} from 'antd';
import App from './App';
import zhCN from 'antd/es/locale/zh_CN';
import {history} from 'libs';
import './index.less';

import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';

dayjs.locale('zh-cn');

const root = ReactDOM.createRoot(document.getElementById("root"))

root.render(
  <Router history={history} basename={import.meta.env.BASE_URL}>
    <ConfigProvider
      locale={zhCN}
      getPopupContainer={node => document.body}
      theme={{
        algorithm: theme.compactAlgorithm,//紧凑模式
        token: {
          motion: false,// 关闭动画
          // colorPrimary: '#E60012',
          // fontSize: 12,//基础字号
          borderRadius: 0,//基础圆角
          colorBgLayout: '#FFF',
          fontWeightStrong: 400,//h1,h2,等字号粗细。默认600
        },
        components: {
          Layout: {
            /* 这里是你的组件 token */
            // headerBg: '#fff',
          },
          Menu: {
            itemBg: 'transparent',
            // itemColor:'#fff',
            horizontalItemSelectedColor: '#FFF',
          },
          Tabs: {
            cardBg: '#FFF',
            cardGutter: 0,
            cardPadding: '6px 24px',
          },
          Table: {
            headerBg: '#DEECFF',
            headerSplitColor: '#CDCDCD',
            borderColor: '#CDCDCD',
            rowHoverBg: '#D2E7FF',
            rowSelectedBg: '#D2E7FF',
          }
        },
      }}
    >
      <App/>
    </ConfigProvider>
  </Router>
);
